home *** CD-ROM | disk | FTP | other *** search
/ Openstep 4.2 (Developer) / Openstep Developer 4.2.iso / NextDeveloper / Source / GNU / make / make-3.74 / winfsinfo.c < prev   
Encoding:
C/C++ Source or Header  |  1996-01-17  |  1.1 KB  |  45 lines

  1.  
  2. #include <windows.h>
  3.  
  4. int main(int argc, char* argv[])
  5. {
  6.     char     fpath[MAX_PATH],full[MAX_PATH];
  7.     LPTSTR    end;
  8.     DWORD    volattr;
  9.  
  10.     if (argc<2)
  11.        exit(256);
  12.     strcpy(fpath,argv[1]);
  13.     end=fpath;
  14.     while(((end=strchr(fpath,'/'))))
  15.         *end='\\';
  16.     GetFullPathName(fpath,
  17.                     MAX_PATH,
  18.                     full,
  19.                     0);
  20.     strcat(full,"\\*");
  21.     end=strstr(full,":");
  22.     if (!end) {
  23.        end=strstr(full,"\\");
  24.        if (end)
  25.           end++;
  26.     }
  27.     if (end) {
  28.        end++;
  29.        *end=0;
  30.     }
  31.     if (GetVolumeInformation(full,
  32.                              0,
  33.                              0,
  34.                              0,
  35.                              0,
  36.                              &volattr,
  37.                              0,
  38.                              0))
  39.       {
  40.        printf("case sensitive file name lookup: %s\n",
  41.               (volattr & FS_CASE_SENSITIVE) ? "supported" : "NOT supported");
  42.        printf("case preserved on disk: %s\n",
  43.               (volattr & FS_CASE_IS_PRESERVED) ? "yes" : "NO");
  44.       }
  45. }